home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Windows 98 Secrets
/
Windows 98 Secrets Gold - Disc 1.iso
/
tools
/
installr
/
osetup
/
setup.exe
/
OSCUSTOM.CPP
next >
Wrap
C/C++ Source or Header
|
1996-02-27
|
1KB
|
53 lines
// OSCustom.cpp Copyright (c) 1996 Celtech Software
//
// Registered users may use this code to create custom DLLs that work with
// O'Setup during the installation process.
//
// This example project was created using Visual C++ 4.00
#include <windows.h>
HWND hParentWindow;
int FAR PASCAL ExampleDLLFunc(HWND hParent, LPCSTR lpParam)
{
//save the setup main window handle
hParentWindow = hParent;
//build a string for message box
char* pMsg = new char[256];
strcpy(pMsg, "Parameter=");
strcat(pMsg, lpParam);
//show string
MessageBox(hParentWindow, pMsg, "DLL Function", MB_OK);
//create buffer for return values to O'Setup
//return values are accessed with the %R variable
HGLOBAL hClip = GlobalAlloc(GMEM_FIXED, 1024);
if(hClip)
{
//get pointer to buffer
char far* pClip = (char far*)GlobalLock(hClip);
if(pClip)
{
//build series of values in the format:
// key=value
// key=value
// key=value
//key/value pairs are separated by return characters
strcpy(pClip, "Value1=This is value 1\rValue2=This is value 2");
GlobalUnlock(hClip);
//set values to unique clipboard format
if(OpenClipboard(hParentWindow))
{
SetClipboardData(RegisterClipboardFormat("OSETUP_RETURN_VALUES"), hClip);
CloseClipboard();
}
}
}
return 1;
}